﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace awsomeSyntezator.PipeLine.Oscilators
{
    class SQRwawe : Oscilator
    {
        public SQRwawe(float _freq, int _rate) : base(_freq, _rate, 1)
        {
            type = 0;
        }
        public SQRwawe(float _freq, int _rate, int strenght) : base(_freq, _rate, strenght)
        {
            type = 0;
        }
        public override double getSample(int n, double sample)
        {
			if(Math.Sin(Math.Abs(frequency * n * 2 * Math.PI / rate)) > 0)
				return 1.0;
        	return -1.0;
        }
    }
}
